package selcoursesys.entity;

import com.opensymphony.xwork2.ActionSupport;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by Lpbdz on 2017/4/8.
 */
@Entity
@Table(name = "academy", schema = "manage_system", catalog = "")
public class AcademyEntity {
    private String aid;
    private String aname;
    private Set askSet=new HashSet();
    private AcademyEntity academyEntity;

    public AcademyEntity(){

    }
    public AcademyEntity(String aid,String aname){
        this.aid=aid;
        this.aname=aname;
    }

    public void setAcademyEntity(AcademyEntity academyEntity) {
        this.academyEntity = academyEntity;
    }

    public Set getAskSet() {
        return askSet;
    }

    public void setAskSet(Set askSet) {
        this.askSet = askSet;
    }

    @Id
    @Column(name = "aid")
    public String getAid() {
        return aid;
    }

    public void setAid(String aid) {
        this.aid = aid;
    }

    @Basic
    @Column(name = "aname")
    public String getAname() {
        return aname;
    }

    public void setAname(String aname) {
        this.aname = aname;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AcademyEntity that = (AcademyEntity) o;

        if (aid != null ? !aid.equals(that.aid) : that.aid != null) return false;
        if (aname != null ? !aname.equals(that.aname) : that.aname != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = aid != null ? aid.hashCode() : 0;
        result = 31 * result + (aname != null ? aname.hashCode() : 0);
        return result;
    }
}
